<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let a = [
            { name: '小明', age: 18 },
            { name: '小王', age: 17 },
            { name: '小丽', age: 16 },
            { name: '小李', age: 15 }
        ]
        // 遍历数组 for of
        for (let [i, e] of a.entries()) {
            console.log(i);//下标
            console.log(e);//每个对象
            console.log(e.name);
        }
    </script>
</body>

</html>